import request from '@/utils/request'

export const getAppointmentsList = (appointmentsData) => {
    return request.get('/appointments/list', { data: appointmentsData })
}

export const updateAppointmentStatus = (id) => {
    return request.post('/appointments/updateAppointmentStatusOk', id)
}

export const addAppointmentsService = (addData) => {
    return request.post('/appointments/add', addData)
}

export const getAppointmentsPageList = (pageNum, pageSize, appointmentsData) => {
    return request.get('/appointments/Pagelist', {
        params: {
            pageNum,
            pageSize,
            ...appointmentsData // 将搜索条件展开为查询参数
        }
    });
};

export const deleteAppointmentsService = (id) => {
    return request.delete(`/appointments/delete/${id}`) // 使用路径参数 /delete/123
}
